package com.epam.ws.anatomist.validation;

import org.custommonkey.xmlunit.Difference;
import org.custommonkey.xmlunit.DifferenceListener;
import org.w3c.dom.Node;

import com.epam.ws.anatomist.log.Logger;

public class DefaultDifferenceListener implements DifferenceListener
{

	private static final String SKIP = "skip";

	@Override
	public int differenceFound(Difference difference)
	{
		String controlNodeValue = difference.getControlNodeDetail().getValue().trim();
		difference.getTestNodeDetail().getValue().trim();
		if (SKIP.equals(controlNodeValue))
		{
			return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL;
		}
		Logger.error(difference.toString());
		return RETURN_ACCEPT_DIFFERENCE;
	}

	@Override
	public void skippedComparison(Node arg0, Node arg1)
	{

	}

}
